package com.szeldon.declatest.declaration.scenario.parts;

import com.szeldon.utils.ValuesUtils;

/**
 * Class encapsulating "Return" part of scenario.
 * 
 * @author szeldon
 * 
 */
public class ReturnPartDeclaration extends ScenarioPartDeclaration {

    private String checkpointId;

    /**
     * Creates "Return" part of scenario.
     * 
     * @param checkpointId
     */
    public ReturnPartDeclaration(String checkpointId) {
        this.checkpointId = ValuesUtils.checkNamedValueForNull("checkpointId", checkpointId);
    }

    @Override
    public ScenarioPartsTypeEnum getPartType() {
        return ScenarioPartsTypeEnum.RETURN;
    }

    public String getCheckpointId() {
        return checkpointId;
    }

    @Override
    public boolean isCondition() {
        return false;
    }

    @Override
    public String toString() {
        return "Return checkpointId=" + checkpointId + ";";
    }

}
